package com.flynn.rock.system.controller;

import com.flynn.rock.model.Response;
import com.flynn.rock.system.model.vo.DeptListVo;
import com.flynn.rock.system.service.SysDeptService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sys/dept")
@AllArgsConstructor
@Tag(name = "系统管理")
public class SysDeptController {

    private SysDeptService sysDeptService;

    @GetMapping("/list")
    @Operation(summary = "获取全部部门列表")
    public Response<List<DeptListVo>> getDeptList() {
        return Response.success(sysDeptService.getDeptList());
    }
}
